package com.sxfans.designmodel.structed.proxy.jse;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class BusinessHandler implements InvocationHandler {
	ITarget target = null;
	public BusinessHandler(ITarget target){
		this.target = target;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		System.out.println("动态代理执行前");
		//Object object = method.invoke(proxy, args);
		System.out.println(method.getName());
		Object obj = method.invoke(target, args);
		System.out.println("动态代理执行后");
		return obj;
	}
	
}
